package com.luo.bbs.front.webapi.controller;


import com.example.bbs.front.service.IBuildingService;
import com.luo.common.restful.JsonResult;
import com.luo.pojo.Building;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author bin.cn
 * @since 2023-01-19
 */
@RestController
@RequestMapping("/building")
public class BuildingController {
    @Autowired
    private IBuildingService buildingService;

    @GetMapping("/all")
    public JsonResult getAll(){
        List<Building> buildings = buildingService.getAll();
        return JsonResult.ok(buildings);
    }

}
